//
// Created by zhaog on 30/03/17.
//

#ifndef IMG_SVR_HTTP_SVR_H
#define IMG_SVR_HTTP_SVR_H
#include "Poco/Net/HTTPServer.h"
#include "Poco/Net/HTTPRequestHandler.h"
#include "Poco/Net/HTTPServerRequest.h"
using Poco::Net::HTTPServerRequest;
using Poco::Net::HTTPServerResponse;
using Poco::Net::HTTPServer;
using Poco::SharedPtr;
using Poco::ThreadPool;
using Poco::Net::HTTPServerParams;
using Poco::Net::ServerSocket;


namespace img_svr {


    class ImgReqHandlerFactory:public Poco::Net::HTTPRequestHandlerFactory{
    public:
//        ImgReqHandlerFactory();
        Poco::Net::HTTPRequestHandler * createRequestHandler(const Poco::Net::HTTPServerRequest& request);
    private:

    };
    class HttpSvr {
    public:
        HttpSvr(uint16_t port=8080,int thread_count=48);
        void start();
    private:
        SharedPtr<HTTPServer> _http_server;
        //SharedPtr<ThreadPool> _thread_pool;
        //Poco::AutoPtr<HTTPServerParams> _http_server_params;
        //SharedPtr<ServerSocket> _server_socket;

    };
}


#endif //IMG_SVR_HTTP_SVR_H
